import Vue from 'vue'
import App from './App.vue'
import VueRouter from 'vue-router'
import XiaomiPhone from './views/Xiaomi.vue'
import RedmiPhone from './views/Redmi.vue'
import XiaomiTv from './views/Tv.vue'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import PhoneShop from './views/PhoneShop.vue';
import ShoppingCart from './views/ShoppingCart.vue'

Vue.use(VueRouter)
Vue.use(ElementUI);


const router = new VueRouter({
  routes: [
    { path: '/Xiaomi', name: 'XiaomiPhone', component: XiaomiPhone },
    { path: '/Redmi', name: 'RedmiPhone', component: RedmiPhone }, // 添加名称
    { path: '/Tv', name: 'XiaomiTv', component: XiaomiTv }, // 添加名称
    { path: '/PhoneShop/:productId', name: 'PhoneShop', component: PhoneShop, props: true },
    { path: '/ShoppingCart/:productId', name: 'ShoppingCart', component: ShoppingCart , props: true}
  ]
})


Vue.config.productionTip = false

new Vue({
  render: h => h(App),
  router
}).$mount('#app')
